package soamonitor

class ServiceUtilsService {

    static transactional = true

    def String checkStatus(String addr) {
		
		try{
			URL url = new URL(addr);
			URLConnection uc = url .openConnection()
			BufferedReader br = new BufferedReader(
			new InputStreamReader(
			uc.getInputStream()))
			String inputLine=null	
			def resp 
			while ((inputLine = br.readLine()) != null)
				resp += inputLine
			br.close()
			return "online"
			
		}
		catch(Exception e){
			return "offline"
		}

    }
}
